﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace Tryit.Converter
{
    public class WinToImageConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            string Win = value as string;
            string Type = parameter as string;
            switch (Type)
            {
                case "baron":
                    if (Win == "胜方")
                    {
                        return "../Common/imgs/baron-100.png";
                    }
                    else return "../Common/imgs/baron-200.png";
                case "dragon":
                    if (Win == "胜方")
                    {
                        return "../Common/imgs/dragon-100.png";
                    }
                    else return "../Common/imgs/dragon-200.png";
                case "inhibitor":
                    if (Win == "胜方")
                    {
                        return "../Common/imgs/inhibitor-100.png";
                    }
                    else return "../Common/imgs/inhibitor-200.png";
                case "tower":
                    if (Win == "胜方")
                    {
                        return "../Common/imgs/tower-100.png";
                    }
                    else return "../Common/imgs/tower-200.png";

            }
            return null;

        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
